import 'package:lcapp/data/app_update_data_entity.dart';

appUpdateDataEntityFromJson(AppUpdateDataEntity data, Map<String, dynamic> json) {
	if (json['androidUpgrade'] != null) {
		data.androidUpgrade = json['androidUpgrade'] is String
				? int.tryParse(json['androidUpgrade'])
				: json['androidUpgrade'].toInt();
	}
	if (json['iosUpgrade'] != null) {
		data.iosUpgrade = json['iosUpgrade'] is String
				? int.tryParse(json['iosUpgrade'])
				: json['iosUpgrade'].toInt();
	}
	if (json['androidUrl'] != null) {
		data.androidUrl = json['androidUrl'].toString();
	}
	if (json['iosUrl'] != null) {
		data.iosUrl = json['iosUrl'].toString();
	}
	if (json['title'] != null) {
		data.title = json['title'].toString();
	}
	if (json['detail'] != null) {
		data.detail = json['detail'].toString();
	}
	if (json['version'] != null) {
		data.version = json['version'].toString();
	}
	return data;
}

Map<String, dynamic> appUpdateDataEntityToJson(AppUpdateDataEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['androidUpgrade'] = entity.androidUpgrade;
	data['iosUpgrade'] = entity.iosUpgrade;
	data['androidUrl'] = entity.androidUrl;
	data['iosUrl'] = entity.iosUrl;
	data['title'] = entity.title;
	data['detail'] = entity.detail;
	data['version'] = entity.version;
	return data;
}